package pacman.entries.pacman;

import pacman.controllers.Controller;
import pacman.game.Constants.MOVE;
import pacman.game.Game;
import edu.ucsc.gameAI.MoveRandomlyAction;
import edu.ucsc.gameAI.MoveTowardsClosestEdibleGhostAction;
import edu.ucsc.gameAI.MoveTowardsClosestPowerPillAction;
import edu.ucsc.gameAI.conditions.AreAnyGhostsEdible;
import edu.ucsc.gameAI.conditions.AreTherePowerPillsLeft;
import edu.ucsc.gameAI.decisionTrees.binary.BinaryDecision;

/*
 * This is the class you need to modify for your entry. In particular, you need to
 * fill in the getAction() method. Any additional classes you write should either
 * be placed in this package or sub-packages (e.g., game.entries.pacman.mypackage).
 */
public class MyPacManDumbTrap extends Controller<MOVE>
{
	private MOVE myMove=MOVE.NEUTRAL;
	
	public MOVE getMove(Game game, long timeDue) 
	{
		//Place your game logic here to play the game as Ms Pac-Man

		//DEFINING THE TREE
		BinaryDecision areGhostsEdibleBinaryDecision = new BinaryDecision();
		BinaryDecision areThereAnyPowerPillsLeftBinaryDecision = new BinaryDecision();
		
		//areThereAnyPowerPillsLeftBinaryDecision.setCondition(new AreTherePowerPillsLeft(game));
		areThereAnyPowerPillsLeftBinaryDecision.setTrueBranch(new MoveTowardsClosestPowerPillAction());
		areThereAnyPowerPillsLeftBinaryDecision.setFalseBranch(new MoveRandomlyAction());
		
		//areGhostsEdibleBinaryDecision.setCondition(new AreAnyGhostsEdible(game));
		areGhostsEdibleBinaryDecision.setTrueBranch(new MoveTowardsClosestEdibleGhostAction());
		areGhostsEdibleBinaryDecision.setFalseBranch(areThereAnyPowerPillsLeftBinaryDecision);
		
		
		
		
		
		//GOING THROUGH THE TREE
		myMove = areGhostsEdibleBinaryDecision.makeDecision(game).getMove();
		return myMove;
	}
}